package com.jiang.admin.core.config;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import com.jiang.admin.core.schedule.JobDynamicScheduler;
import com.jiang.admin.dao.JobInfoDao;
import com.jiang.admin.dao.JobLogDao;

/**
 * 
 * @author jiangyougan 2018年12月2日 下午7:35:04
 *
 */
@Configuration
public class JobAdminConfig implements InitializingBean {
	
	private static final Logger logger = LoggerFactory.getLogger(JobAdminConfig.class);

	private static JobAdminConfig adminConfig = null;

	/**
	 * 初始化单例对象
	 */
	@Override
	public void afterPropertiesSet() throws Exception {
		logger.info("JobAdminConfig InitializingBean afterPropertiesSet()...");
		adminConfig = this;
	}
	
	/**
	 * 获取配置
	 * @return
	 */
	public static JobAdminConfig getAdminConfig() {
		return adminConfig;
	}

	@Resource
	private RestTemplate restTemplate;
	@Resource
	private JobLogDao jobLogDao;
	@Resource
	private JobInfoDao jobInfoDao;

	public RestTemplate getRestTemplate() {
		return restTemplate;
	}

	public void setRestTemplate(RestTemplate restTemplate) {
		this.restTemplate = restTemplate;
	}

	public JobLogDao getJobLogDao() {
		return jobLogDao;
	}

	public void setJobLogDao(JobLogDao jobLogDao) {
		this.jobLogDao = jobLogDao;
	}

	public JobInfoDao getJobInfoDao() {
		return jobInfoDao;
	}

	public void setJobInfoDao(JobInfoDao jobInfoDao) {
		this.jobInfoDao = jobInfoDao;
	}

}
